package com.loveyukari.dao.impl;

import com.loveyukari.dao.AuthOldNameDao;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class JdbcAuthOldNameDao extends BaseDao implements AuthOldNameDao {
    @Override
    public void insertAuthOldName(String name, int authId) {
        String sql = "insert into auth_old_name (name,auth_id) values(?,?)";
        this.getJdbcTemplate().update(sql,name,authId);
    }

    @Override
    public List<String> selectAuthOldName(int authId) {
        String sql = "select name from auth_old_name where auth_id = ? order by id desc";
        return this.getJdbcTemplate().queryForList(sql,String.class,authId);
    }
}
